package com.example.suspendedscreenshot.ui

import android.os.Build
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.annotation.RequiresApi
import com.example.suspendedscreenshot.databinding.ActivityMainBinding
import com.twm.tamauth.sdk.MyOpenSDK


@RequiresApi(Build.VERSION_CODES.O)
class MainActivity : AppCompatActivity() {

    private lateinit var binding: ActivityMainBinding

    private val gameId = "com.tencent.tmgp.sgame"
    private val gameName = "王者荣耀"
    private val userToken = "fzx99kyjcb93qdejomyyfdntt65f1rzjo20rsz959o0uxkl9bix7z954frzzum2b"
    private val orderId = "1603"

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)

        setupListeners()
    }

    /**
     * Initialize onClick listeners for the buttons.
     */
    private fun setupListeners() {
        binding.tvOpenShowFloat.setOnClickListener {
            /**<must start service first>*/
            MyOpenSDK.startAuth(this,gameId, gameName = gameName, userToken = userToken, orderId = orderId)
        }
    }
}

